package cn.tedu.micro.order;

import cn.tedu.micro.common.pojo.protocol.JsonResult;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

@SpringBootTest
public class OrderTestApplication {
    RestTemplate restTemplate = new RestTemplate();
    @Test
    void testGun(){
        String url = "http://localhost:8088/device/gun/info/1";
        JsonResult vo1 = restTemplate.getForObject(url, JsonResult.class);
        System.out.println(vo1);

        HttpMethod method = HttpMethod.GET;
        ResponseEntity<JsonResult> response = restTemplate.exchange(url, method, null, JsonResult.class);
        JsonResult vo2 = response.getBody();
        System.out.println(vo2);
    }
}
